import os

import pytest
import pymysql
from config.config import *

@pytest.fixture(scope='session',autouse=True)
def f():
    print("初始化")
    yield

    sqls = [SQL1,SQL2]
    conn = pymysql.connect(
        # host = DB_HOST,
        # port = DB_PORT,
        # database= DB_DATABASE,
        # user = DB_USER,
        # password = DB_PASSWORD,
        **(eval(os.environ["DB"])),
        charset = 'utf8',
        autocommit = True
    )
    cur = conn.cursor()
    # for sql in sqls:
    #     cur.execute(sql)
    cur.close()
    conn.close()
    print("测试数据删除完毕")

